# -*- coding: utf-8 -*-
# @Time : 2021/9/17 21:43
# @Author : 伟哥
# @Email : xw@gmail.com
# @File : my_page.py
# @Project : mryx_test
'''我的页面定位器，以及操作'''
from appium.webdriver.common.mobileby import MobileBy as By
from page.base_page import BasePage

class My(BasePage):
    '''我的页面'''
    my_locator = (By.XPATH, '//android.widget.TextView[@resource-id=\"cn.missfresh.application:id/mineTab\"]') #我的定位器
    address_locator = (By.XPATH, '//android.widget.ImageView[@content-desc=\"收货地址\"]')  #收货地址定位器
    customer_servicea_locator = (By.XPATH, '//android.widget.ImageView[@content-desc=\"客服和帮助\"]')
    set_locator = (By.XPATH, '//android.widget.ImageView[@content-desc=\"设置\"]')

    def my(self):
        '''点击我的操作'''
        self.driver.find_element(*self.my_locator).click()

    def address(self):
        '''点击收货地址'''
        self.driver.find_element(*self.address_locator).click()

    def customer(self):
        '''点击客服与帮助'''
        self.driver.find_element(*self.customer_servicea_locator).click()

    def set(self):
        '''点击设置'''
        self.driver.find_element(*self.set_locator).click()


